#ifndef VENUS_SHAPES_SPHERE_H
#define VENUS_SHAPES_SPHERE_H

#include "common/venus.h"
#include "shape.h"
#include "geometry/point.h"
#include "geometry/aabb.h"

namespace venus {
class Sphere : public Shape {
 public:
  Sphere(const Point& center, float radius) 
      : center_(center), radius_(radius) { }

  virtual int Intersect(const Ray &ray, float *thit, 
                        DifferentialGeometry *dg) const;
  virtual int Intersect(const Ray &ray) const;

  AABB Bound() const {
    const Vector3 offset(radius_);
    return AABB(center_ - offset, center_ + offset); 
  }
  const Point &center() const { return center_; }
  void set_center(const Point &center) { center_ = center; }
  float radius() const { return radius_; }
  void set_radius(float radius) { radius_ = radius; }

private:
  Point center_;
  float radius_;
};
}//namespace venus

#endif
